<?xml version="1.0" encoding="UTF-8"?>
<!--
  User: Dmitry Leontyev
  Date: 11.12.10
  Time: 23:12
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

<h:head>
    <title>Регистрация</title>
    <f:metadata>
        <f:event type="preRenderView" listener="#{flash.keep('registerAccount')}"/>
    </f:metadata>
</h:head>

<h:body>
    <h1>Регистрация</h1>

    <h:form>
        <h:panelGrid columns="3">
            <h:outputLabel for="login" value="Имя пользователя (логин):"/>
            <h:inputText id="login" value="#{registerService.account.username}"/>
            <h:message for="login"/>

            <h:outputLabel for="password" value="Пароль:"/>
            <h:inputSecret id="password" value="#{registerService.account.password}"/>
            <h:message for="password"/>

            <h:outputLabel for="email" value="Email:"/>
            <h:inputText id="email" value="#{registerService.account.email}"/>
            <h:message for="email"/>

            <h:outputLabel for="captchaimg" value="Капча:"/>
            <h:graphicImage id="captchaimg" value="/CaptchaImage"/>
            <h:message for="captchaimg"/>

            <h:outputLabel for="captchaval" value="Текст с картинки:"/>
            <h:inputText id="captchaval" value="#{registerService.captchaValue}" />
            <h:message for="captchaval"/>
        </h:panelGrid>

        <h:commandButton action="#{registerService.doRegister}" value="Зарегистрироваться"/>
    </h:form>
</h:body>
</html>